package loop;

import java.util.Scanner;

public class Guess_The_Number {
    public static void main(String[] args) {

        Scanner scanner = new Scanner( System.in ) ;
        int number ;
        int n = 0;
        int random = (int)(1000*Math.random());
        System.out.println( random );
        System.out.println( "请输入你的猜测吧！" ) ;
        while (true){
            n++ ;
            number = scanner.nextInt() ;
            if(number < random){
                if (n > 10){
                    System.out.println( " 你太笨了，下次再来吧 ！");
                    break;
                }
                System.out.println( " 太小了,再大一点 ！");
            }else if( number > random) {
                if (n > 10){
                    System.out.println( " 你太笨了，下次再来吧 ！");
                    break;
                }
                System.out.println(" 太大了,再小一点 ！");
            }
            else {
                System.out.println(" 恭喜你猜对了 ！");
                break;
            }

        }
    }
}
